<template>
    <van-nav-bar title="充值记录" left-text="" left-arrow @click-left="goBack" />
    <div class="item" v-for="(item,index) in consumlist" :key="index">
        <div class="left">{{item.content}}</div>
        <div class="right">{{item.createtime}}</div>
    </div>
</template>
<script setup>
import { onBeforeMount, onMounted } from 'vue';
const { cookies } = useCookies();
const LoginUser = reactive(cookies.get("LoginUser") ?? {});
const consumlist = ref([]);
onBeforeMount(()=>{
  getconsumData();
    
});
const getconsumData =async ()=>{
    let result = await Api.rechargelist(
        {
            busid: LoginUser.id
        }
    );
    if(result.code==1){
        consumlist.value = result.data;
    }
}
const router = useRouter();
const goBack = () => {
    router.push("/business/base/index");
}
</script>
<style>
.item{
    width: 95%;
    margin: auto;
    margin-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.left{
    font-size: 14px;
    width: 200px;
}
.right{
    color: #ccc;
}
</style>